package models

import (
	"go-mgdms/internal/common/config"
)

// AdminGroupModel 管理员用户组数据模型
type AdminGroupModel struct {
	ID         uint    `gorm:"type:int;primaryKey;autoIncrement;unsigned;comment:ID" json:"id"`
	Pid        uint    `gorm:"type:int;not null;default:0;unsigned;comment:上级分组" json:"pid"`
	Name       string  `gorm:"type:varchar(100);not null;default:'';comment:组名" json:"name"`
	Rules      *string `gorm:"type:text;comment:权限规则ID" json:"rules"`
	Status     uint8   `gorm:"type:tinyint;not null;default:1;unsigned;comment:状态:0=禁用,1=启用" json:"status"`
	UpdateTime *uint64 `gorm:"type:bigint;unsigned;comment:更新时间" json:"update_time"`
	CreateTime *uint64 `gorm:"type:bigint;unsigned;comment:创建时间" json:"create_time"`
}

// TableName 设置表名
func (AdminGroupModel) TableName() string {
	return config.GetTablePrefix() + "admin_group"
}
